package ma.co.ba.BusinessApplications.presentation.components;

import java.beans.PropertyEditorSupport;

import ma.co.ba.BusinessApplications.business.tickets.TicketBusiness;
import ma.co.ba.BusinessApplications.model.Criticite;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class CriticiteEditor extends PropertyEditorSupport {
	@Autowired
	TicketBusiness ticketBusiness;

	@Override
	public void setAsText(String text) {
		// Country c = this.countryService.findById(Long.valueOf(text));
		Criticite criticite = this.ticketBusiness.getCriticiteById(Integer
				.valueOf(text));

		this.setValue(criticite);
	}

}
